package com.token.sysflow.enumerate;

/**
 * 审批类型
 */
public enum ApprovalTypeEnum {
    /**
     * （起草，普通审批，会审，会签，主-子流程，组织会审，组织会签）
     */
    KS(0,"起草"),
    SP(1,"普通审批"),
    HS(2,"会审"),
    HQ(3,"会签"),
    MZLC(4,"主-子流程"),
    ZZHS(5,"组织会审"),
    ZZHQ(6,"组织会签");

    private final int id;
    private final String name;
    ApprovalTypeEnum(int id,String name) {
        this.id = id;
        this.name = name;
    }


    public int getId() {
        return id;
    }

    public String getName(){
        return name;
    }


    public static String getNameByValue(int value){
        for (ApprovalTypeEnum enums : ApprovalTypeEnum.values()) {
            if (enums.getId() == value) {
                return enums.getName();
            }
        }
        return null;
    }

    public static ApprovalTypeEnum getTypeByValue(int value){
        for (ApprovalTypeEnum enums : ApprovalTypeEnum.values()) {
            if (enums.getId()==value) {
                return enums;
            }
        }
        return null;
    }
}